home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
UTILENUS
/
DOSMENU.LZH
/
DOSMENU.ARC
/
DOSMENU.DOC
< prev
next >
Wrap
Text File
|
1991-05-29
|
9KB
|
233 lines
DOSMENU
| NOTE:
| Changes to this document since version 1.00 are marked with a '|'
| to the left of the changed or new line.
Description
DOSMENU is a program which displays a menu of options, and
allows one to be selected. The commands for that option are
executed, then the menu is re-displayed. This allows programs
to be used easily, without having to remember the particular
combination of DOS commands required to run them.
Command Format
dosmenu [menufile]
DOSMENU uses the file DOSMENU.TXT by default. DOSMENU.TXT contains
a description of the options displayed on the menu, and the commands
executed by each option. Any number of files can be set up for use
with DOSMENU. To use one of these alternate files, specify the name
of the file on the command line, and the alternate file will be used.
Setting up the menu description file
For example, say that we want to be able to use the LD program
from the menu. Assume that LD is on your C drive, in the directory
DOS. To use a program from a menu, we first need to enter it into
the menu, in this manner:
1) Edit the file DOSMENU.TXT. SBE may be used for this purpose by
entering:
sbe dosmenu.txt
SBE is included in DABUTIL, which is available from Simian Id Software.
2) Add these lines to the file: If DOSMENU.TXT already has something
in it, then add these lines to the end. If the menu entry for
"A" has already been used, then use a different letter.
A
List all the directories on this disk
C:\DOS\LD;
PAUSE
The first character of the first line is the menu option letter.
You may any printable character here, such as A, M, 0, 1, @, #, &,
and so forth. A character may be use only once.
The second line is the description that will displayed when the
menu is on the screen.
The third and following lines are DOS commands that are needed to
run the program. The final DOS command, "PAUSE", will leave the
display on the screen until you press a key, so that you can see
the display before returning to the menu. In this case, two
commands are required, so the first one ends with ';' to indicate that
more commands follow. Whenever more than one command is required, use
a semicolon (;) on all commands except for the last.
This is the general format used in DOSMENU.TXT to set up a menu:
A
Description
Command
B
Description
Command1;
Command2;
Command3
C
Description
#Command1;
Command2
| D
| Description
| %a prompt 1;
| Command1;
| Command2;
| Command3
| E
| Description
| #%a prompt 1;
| %b prompt 2;
| Command1;
| Command2;
| Command3
.
.
.
Each item to be displayed on your menu requires:
1 - A character to be entered by the user.
2 - A description to be shown to the user.
3 - The command or commands, as you would enter them at the
DOS prompt, including any arguments. If there are more
commands than one to execute for the option, follow each
with a semicolon (;) except for the last one.
These three things must be entered for each option, on separate
lines, in the order given. The first option can be any printable
character: letter, number or any character that you can type at
the keyboard.
If a pound sign precedes the first command in the sequence, DOSMENU
recognizes that it should release all the memory it uses before it
executes the commands. It is known as the "zero-RAM" option, since
DOSMENU uses no memory when executing programs in this way. The third
menu option specified above uses the "zero-RAM" option. It is useful for
large programs which would not execute unless they have all your
memory available.
| A '%' may proceed a number of lines before any commands. These are
| prompt lines, which are use to query the user to enter a value. These
| values can the be used to supply parameters to the program which runs.
| For example:
| B
| An example of a menu entry which uses a prompt
| %A Please enter the disk letter to check:;
| chkdsk %A:;
| pause
| When this menu option is selected, the user will be presented with
| the prompt "Please enter the disk letter to check:". The letter
| entered will be saved in the variable %A and will be used in the
| chkdsk command.
| The prompt option can be used in conjunction with the zero-RAM option,
| by proceeding the first prompt with the '#' symbol:
| C
| An example of a menu entry which uses a prompt and the zero-RAM option
| #%A Please enter the disk letter to check:;
| chkdsk %A:;
| pause
Displaying the Menu
To display the menu that you have just set up, type DOSMENU and
press RETURN. The file DOSMENU.TXT needs to be in the current
directory, and the file DOSMENU.COM should be in the current
directory or in a directory specified by the PATH command. You can
have the menu displayed when your computer is first turned on by
putting the command DOSMENU into your AUTOEXEC.BAT file.
To use DOSMENU with more than one menu, you may create menu files
with names other than DOSMENU.TXT, for example:
Create a file called DOSMENU.TX2, in the same manner as described
above. Then, execute DOSMENU by typing this command:
dosmenu dosmenu.tx2
This tells DOSMENU to use the alternate menu instead of DOSMENU.TXT.
You can create a number of menu files, and then specify which one
you want to use.
For an example of how to use alternate menus, see the files
PRINTER.BAT and PRINTER.TXT included with DABUTIL. PRINTER.BAT
is a batch file which executes DOSMENU using the menu option
file PRINTER.TXT. SBE is included in DABUTIL, which is available from
Simian Id Software.
DOSMENU troubleshooting hints
- If nothing will execute, it may be that DOSMENU cannot find your
COMMAND.COM file. This will happen if COMMAND.COM is hidden, or
may happen if you used the SET command to change the COMSPEC
variable. If COMMAND.COM is hidden because you need to protect
it, try setting the Read-only attribute instead.
- If a command in DOSMENU.TXT fails, DOSMENU will not attempt to
execute subsequent commands.
- If you get the error message "Option too long" this can refer to
the letter, the description, or the commands. The letter must be
one character, the description can be up to 75 characters. A
command can be up to 180 characters long. If a command is
rejected as too long, and it is less than 180 characters, check
to make sure that the previous command ends with a semi-colon (;).
- If an option executes, but the display returns to the menu to
quickly to read it, add the PAUSE command as the last command
for that option.
- If you have a large program which executes correctly from the
DOS prompt, but will not work from DOSMENU, try this:
DOS commands as entered a prompt:
cd \word5
word
Use these commands in DOSMENU.TXT:
#cd \word5;
word
The '#' used as the first character of the first command tells
DOSMENU to write all the commands for this option to a batch
file, then execute the batch file. This "zero-RAM" option frees
the memory used by DOSMENU, so that your large application will
have enough memory to execute. One example of a large program
that requires this option is "Where in Time is Carmen SanDiego"
used with a VGA monitor.
The semicolon on the end of the first command tells DOSMENU that
the next line of the file is another command for the same option,
as shown before.
Note that DOSMENU will create a file named '$DOSM01$.BAT' whenever
it is used, so the presence of this file on your disk is normal.
This file is used to implement the "zero-RAM" option, but must always
be present to satisfy DOS when it is used.
| Version 2.10: DOSMENU now creates a file named '$DM01$.BAT' which
| is erased when it is no longer needed.